package com.day.controller;

import com.day.pojo.School;
import com.day.service.SchoolService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/school")
public class SchoolController {

    @Autowired
    private SchoolService schoolService;

    @RequestMapping("/getSchoolList")
     public List<School> getSchoolList(){
        return schoolService.getSchoolList();
    }
    @RequestMapping("/getSchoolById")
    public School getSchoolById(Integer s_id){
       return schoolService.getSchoolById(s_id);
    }
    @RequestMapping("/addSchool")
    public void addSchool(School school){

        schoolService.addSchool(school);
}
    @RequestMapping("/delSchoolById")
    public void delSchoolById(Integer s_id){

        schoolService.delSchoolById(s_id);
}
    @RequestMapping("/editSchoolById")
    public void editSchoolById(School school){

        schoolService.editSchoolById(school);
            }
}
